<?php
use yii\helpers\Html;
use yii\helpers\Url;
/* @var $this \yii\web\View */
/* @var $content string */

//\frontend\assets\MktWapCommonAsset::register($this);
?>
<!--
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="keywords" content="首页关键字" />
  <meta name="description" content="首页描述" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Cache-Control" content="no-cache" />
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=2.0" />
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  
  <link rel="stylesheet" href="../resources/css/weui/weui.min.css">
  <link rel="stylesheet" href="../resources/css/main.min.css">
  <link rel="stylesheet" href="../resources/css/man.min.css">
  
  <script src="../resources/js/jquery-1.10.min.js"></script>
  <script src="../resources/js/jquery.touchSwipe.min.js"></script>
  <script src="../resources/js/frmwebm.min.js"></script>
  <title>隐私设置</title>
</head>
<body style="background: #ebebeb none repeat scroll 0 0;">

-->
<?php $this->title = '隐私设置' ?>
<div class="weui_cells weui_cells_form">
    <div class="weui_cell weui_cell_switch">
        <div class="weui_cell_hd weui_cell_primary"><span style="color:#999999">对好友显示</span><span>手机号码</span></div>
        <div class="weui_cell_ft">
            <input  onclick="toggle('on_show_mobile')" type="checkbox" <?php echo $model->on_show_mobile ? 'checked="checked"' : ''; ?> class="weui_switch">

        </div>
    </div>
    <div class="weui_cell weui_cell_switch">
        <div class="weui_cell_hd weui_cell_primary"><span style="color:#999999">对好友显示</span><span>QQ号码</span></div>
        <div class="weui_cell_ft">
            <input  onclick="toggle('on_show_qq')" type="checkbox" <?php echo $model->on_show_qq ? 'checked="checked"' : ''; ?> class="weui_switch">
        </div>
    </div>
    <div class="weui_cell weui_cell_switch">
        <div class="weui_cell_hd weui_cell_primary"><span style="color:#999999">对好友显示</span><span>微信号码</span></div>
        <div class="weui_cell_ft">
            <input  onclick="toggle('on_show_weixin')" type="checkbox" <?php echo $model->on_show_weixin ? 'checked="checked"' : ''; ?> class="weui_switch">

        </div>
    </div>
    <div class="weui_cell weui_cell_switch">
        <div class="weui_cell_hd weui_cell_primary"><span style="color:#999999">对好友显示</span><span>邮箱号码</span></div>
        <div class="weui_cell_ft">
            <input  onclick="toggle('on_show_email')" type="checkbox" <?php echo $model->on_show_email ? 'checked="checked"' : ''; ?> class="weui_switch">

        </div>
    </div>
</div>
<div class="weui_cells weui_cells_access">

    <?php if (empty($model->qq)): ?> 
    <a href="<?php echo Url::to(['wap/self-personal-qq']); ?>" class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary weui_cell_text">
            <p>QQ号码未填写</p>
        </div>
        <div class="weui_cell_ft">去补充</div>
    </a>
    <?php endif; ?>

    <?php if (empty($model->weixin_number)): ?> 
    <a href="<?php echo Url::to(['wap/self-personal-weixin']); ?>" class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary weui_cell_text">
            <p>微信号码未填写</p>
        </div>
        <div class="weui_cell_ft">去补充</div>
    </a>
    <?php endif; ?>

    <?php if (empty($model->email)): ?> 
    <a href="<?php echo Url::to(['wap/self-personal-email']); ?>" class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary weui_cell_text">
            <p>邮箱未填写</p>
        </div>
        <div class="weui_cell_ft">去补充</div>
    </a>
    <?php endif; ?>

</div>

<script type="text/javascript">
function toggle(field) {
	var args = {
		'classname': '\\common\\models\\MktUser',
		'funcname': 'toggleAjax',
		'params': {
			'id' : <?php echo \common\wosotech\Util::getSessionUserId(); ?>,
			'field': field
		}
	};

	$.ajax({
		url: "<?= Url::to(['/wap/ajax-broker']); ?>",
		type: "GET",
		cache: false,
		dataType: "json",
		data: "args=" + JSON.stringify(args),
		success: function (resp) {
			if (resp['code'] != 0) {
//				alert("handle error");
//				return;
				frmwebm.prompt({
					title: "友情提示",
					content: resp['msg'],
                    reload: true
				});
				return;
			}
		},
		error: function () {
			//alert('send error');
		}
	});
}

</script>

<!--
</body>
</html>
-->
